<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$meta_title|default=''}</h2>
    </div>

    <div class="cf">
        <button class="btn ajax-post confirm" url="{:U('delete_apply')}" target-form="ids">删 除</button>
        <a class="btn" href="{:U('index')}" target-form="ids">返回职位列表</a>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="keyword" class="search-input" value="{:I('keyword')}" placeholder="请输入姓名或电话">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('view_apply')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>

    <div class="data-table table-striped">
        <table>
            <thead>
                <tr>
                    <th class="row-selected">
                        <input class="checkbox check-all" type="checkbox" name="id[]">
                    </th>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>电话</th>
                    <th>应聘职位</th>
                    <th>应聘时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.sex}</td>
                        <td>{$vo.phone}</td>
                        <td>{$vo.apply_job}</td>
                        <td>{$vo.apply_time}</td>
                        <td>
                            <a class="confirm ajax-get" title="删除" href="{:U('delete_apply?id='.$vo['id'])}">删除</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
        <!-- 分页 -->
        <div class="page">
            {$_page}
        </div>
    </div>
</block>
<block name="script">
    <script type="text/javascript">
        $(function () {
            //搜索功能
            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function (e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });
        });
    </script>
</block>